function backform() {
	window.location.href = 'userInstitutionAdd.jsp';
}
$.ajax({
	url: 'paramTypeList',
	type: 'POST',
	data: {
		session: $.Cookie("session"),
		userId: $.Cookie("userId"),
		companyId: $.Cookie("companyId"),
		index: 0,
		page: 20
	},
	dataType: 'json',
	success: function(data) {
		if(data.errorCode == 0) {
			$.each(data.result.paramTypeList, function(i, value) {
				if(data.result.paramTypeList[i].type == "DVC_TYPE") {

				} else {
					error_tpl = '<option value="' + data.result.paramTypeList[i].id + '">' + data.result.paramTypeList[i].paramValue + '</option>"'
					$("#org").append(error_tpl)
				}

			});
		} else if(data.errorCode == -6) {
			alert("登录超时！")
			top.location.href = 'index.jsp';
			
		} else {
			alert("请重试！")
		}

	},
	error: function(err) {

		alert("连接服务器失败！请重新提交！")
			top.location.href = 'index.jsp';
		
	}
});
var treeId = sessionStorage.getItem("treeId") || 001;
var treeCode = sessionStorage.getItem("treeCode") || "001_";
treeCode = treeCode + $("#orgId").val()

function formform() {
	var param = {
		session: $.Cookie("session"),
		userId: $.Cookie("userId"),
		companyId: $.Cookie("companyId"),
		orgId: $("#orgId").val(),
		orgName: $("#orgName").val(),
		highOrg: treeId,
		treeCode: treeCode,
		principal: $("#principal").val(),
		phone: $("#phone").val(),
		address: $("#address").val(),
		province: $("#province").val(),
		city: $("#city").val(),
		area: $("#area").val(),
		org: $("#org option:selected").val(),
		orgType:$("#org option:selected").val(),
	}
	$.ajax({
		url:'addOrganization',
		type: 'POST',
		data: param,
		dataType: 'json',
		success: function(data) {
			if(data.errorCode == 0) {
			parent.location.href= 'userInstitution.jsp';
				
			} else if(data.errorCode == -6) {
				alert("登录超时！");
			top.location.href = 'index.jsp';
				
			} else {
				alert("请重试！")
			}

		},
		error: function(err) {
		
			alert("连接服务器失败！请重新提交！");
			top.location.href = 'index.jsp';
			
		}
	});
}